
package com.tinem.platform.module.starter.jpa.repository.oauth2;

import com.tinem.platform.module.starter.jpa.entity.oauth.UserSessionToken;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @author fengzhihao
 * @version v1
 * @program: platform
 * @description TODO
 * @site https://fzh.cloud/
 * @company
 * @create 2021-6-11 11:31
 */
@Repository
public interface UserSessionTokenRepository extends JpaRepository<UserSessionToken, String> {

    /**
     * 查询当前用户未过期的session
     * @param userId userId
     * @param exp 过期时间
     * @return
     */
    List<UserSessionToken> findByUserIdAndExpAfter(String userId, Date exp);

}